From: Keir Fraser Date: Wed, 22 Oct 2008 11:08:16 +0000 (+0100) Subject: x86, hvm: Allow 100us periodic virtual timers X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14054^2~54 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=cdd644ce1082849d20832902d8d5a69b854f8cbe;p=xen.git x86, hvm: Allow 100us periodic virtual timers Adjust vpt and hpet minimum period (for timers) from 900us to 100us to be able to pass Windows 2008 compatibility tests. Signed-off-by: Peter Johnston --- diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index 2da14c6ee4..42c5c58fab 100644 --- a/xen/arch/x86/hvm/hpet.c +++ b/xen/arch/x86/hvm/hpet.c @@ -421,11 +421,11 @@ static int hpet_write( { /* * Clamp period to reasonable min/max values: - * - minimum is 900us, same as timers controlled by vpt.c + * - minimum is 100us, same as timers controlled by vpt.c * - maximum is to prevent overflow in time_after() calculations */ - if ( hpet_tick_to_ns(h, new_val) < MICROSECS(900) ) - new_val = (MICROSECS(900) << 10) / h->hpet_to_ns_scale; + if ( hpet_tick_to_ns(h, new_val) < MICROSECS(100) ) + new_val = (MICROSECS(100) << 10) / h->hpet_to_ns_scale; new_val &= (timer_is_32bit(h, tn) ? ~0u : ~0ull) >> 1; h->hpet.period[tn] = new_val; } diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index 27bacd9b28..d9730bf140 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -368,13 +368,13 @@ void create_periodic_time( pt->do_not_freeze = 0; pt->irq_issued = 0; - /* Periodic timer must be at least 0.9ms. */ - if ( (period < 900000) && period ) + /* Periodic timer must be at least 0.1ms. */ + if ( (period < 100000) && period ) { if ( !test_and_set_bool(pt->warned_timeout_too_short) ) gdprintk(XENLOG_WARNING, "HVM_PlatformTime: program too " "small period %"PRIu64"\n", period); - period = 900000; + period = 100000; } pt->period = period;